<?php
namespace app\admin\controller;
// use think\Db;
// use think\captcha\Captcha;
class Addpermission extends Come{
    public function addpermission(){
        $res=db('modular')->where('pid>1' )->select();
        $this->assign('res',$res);
        return $this->fetch('addpermission');
    }
    public function tianjia(){
        $data=input('param.','','htmlspecialchars');
        $name=input('param.name','','htmlspecialchars');
        $mid=input('param.mid','','htmlspecialchars');
        $controller=input('param.controller','','htmlspecialchars');
        $method=input('param.method','','htmlspecialchars');

        $ret=db('jurisdiction')->insertGetId($data);
        if($ret>0){
            $this->success('发布成功!','admin/addpermission/addpermission');
        }else{
            $this->error('发布失败');
        }
    }
}